<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.zmht.specedu.vo.Fengongtype"%>
<%@page import="com.zmht.specedu.frame.model.PageInfoModel"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<fmt:setBundle basename="PathResource" scope="session" />
<%
	/**
	 * @author 张天兴
	 * @since 2009/05/08
	 */
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb18030" />
<title>聋校备课与语言学习及矫治系统</title>
<link href="<%=request.getContextPath()%>/<fmt:message key='StylePath' />style.css" rel="stylesheet" type="text/css" />

		<script type="text/javascript">
          
          function addFengongLeibie(operateType){
			if(operateType=="modify"){
		    	document.forms[0].action="fengongAction.do?method=update";
			}else{
				document.forms[0].action="fengongAction.do?method=save";
			}
			var name = document.forms[0].fengongAdd.value;
			var fengongId = document.forms[0].fengongId.value;
			if(operateType == "modify" && fengongId==""){
				alert("请先选择要修改的行！");
				return;
			}
			
			if(name==""){
				alert("类别名称必须填写！");
				return;
			}
			document.forms[0].submit();
		  }
                                                                  
          function toModifyType(id,name,type){
		   document.getElementById("addButton").style.display="none";
		   document.getElementById("modifyButton").style.display="block";
		   document.forms[0].fengongAdd.value=name;
		   document.forms[0].fengongId.value=id;   

	    }
          
          function deleteItem(id)
          {
          if(confirm("确认要删除吗?"))
          window.location.href="<%=request.getContextPath()%>/fengongAction.do?method=delete&id="+id;
          }     
        </script>
</head>

<body class="bcolor">
<form name="form1" method="post" action="fengongAction.do?method=list">
  <input type=hidden name="flag" value="3" />
  <table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#a7c8e6">
    <tr>
      <td><table width="100%" border="0" align="center" cellpadding="3" cellspacing="0" class="fontbot">
        <tr>
          <td  align="left" valign="middle" bgcolor="#FFFFFF">
          <table width="95%" border="0" >
										<tr>
											<td width="50%">
												<input name="fengongAdd" type="text" class="boxcopy2"
													id="textfield10" maxlength="40" style="width: 350px; height: 22px;" />
												<input type="hidden" name="fengongId" />
												<a href="javascript:query();" onfocus="this.blur()"> </a>
											</td>
											<td align="left">
												<img id="addButton"  onclick="addFengongLeibie('save');"
													src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />gif-01.gif" width="63" height="22" border="0" />
												<img id="modifyButton" style="display: none; cusor: hand;"
													onclick="addFengongLeibie('modify');"
													src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />jz_img/xiugai.gif" width="53" height="22"
													border="0" />
										   </td>
										</tr>
									</table>
          </td>

        </tr>
      </table></td>
    </tr>
  </table>
  <table cellspacing="0" cellpadding="0" width="99%" align="center" border="0">
    <tbody>
      <tr>
        <td width="7"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_01.gif" 
      width="7" /></td>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_05.gif"><table cellspacing="0" cellpadding="0" width="100%" border="0">
            <tbody>
              <tr>
                <td width="30"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_02.gif" 
            width="30" /></td>
                <td align="left" width="200" 
            background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_03.gif">&nbsp;<strong>分 工 类 别 维 护</strong></td>
                <td width="59"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_04.gif" 
            width="59" /></td>
                <td>&nbsp;</td>
              </tr>
            </tbody>
        </table></td>
        <td width="8"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_06.gif" 
      width="8" /></td>
      </tr>
      <tr>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_07.gif"><img height="1" 
      src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />spacer.gif" width="1" /></td>
        <td bgcolor="#f7fbff"><table cellspacing="1" bordercolordark="#ccccff" cellpadding="3" width="100%" 
      bgcolor="#cfe5f5" bordercolorlight="#ffffff" border="0">
            <tbody>
              <tr bgcolor="#a4c9ec">
                <td width="20" align="middle">&nbsp;</td>
                <td align="middle"><strong>类别名称</strong></td>
                <td width="15%" align="middle" bgcolor="#a4c9ec"><strong>编 辑</strong></td>
                <td width="15%" align="middle" bgcolor="#a4c9ec"><strong>删 除</strong></td>
              </tr>
               <%int k=0; %>
          <logic:iterate id="result"  name="pagenitionModel" property="resultItems">
              <tr bgcolor="#ffffff">
                <td><%=++k %>.&nbsp;</td>
                <td align="middle" bgcolor="#ffffff"><bean:write name="result" property="name"/></td>
                <td align="middle"><a href="javascript:toModifyType('<bean:write name="result" property="id" />','<bean:write name="result" property="name" />','编辑分工类别');" onfocus="this.blur()"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />bianji.gif" width="16" height="16" border="0" /></a></td>
                <td align="middle"><a href="javascript:deleteItem(<bean:write name="result" property="id" />)" onfocus="this.blur()"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />de.gif" width="16" height="16" border="0" /></a></td>
              </tr>
         </logic:iterate>
              
              



            </tbody>
          </table>
            <table cellspacing="1" cellpadding="0" width="100%" bgcolor="#ffffff" 
        border="0">
              <tbody>
                <tr>
                  <td align="middle" bgcolor="#e6f0f8">
	              <jsp:include page="../../common/pagination.jsp"></jsp:include>
                  </td>
                </tr>
              </tbody>
          </table></td>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_09.gif"><img height="1" 
      src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />spacer.gif" width="1" /></td>
      </tr>
      <tr>
        <td><img height="22" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_10.gif" width="7" /></td>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_11.gif">&nbsp;</td>
        <td><img height="22" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_12.gif" 
  width="8" /></td>
      </tr>
    </tbody>
  </table>
</form>
</body>
</html>
